#ifndef CSGCONTROLLER_H
#define CSGCONTROLLER_H

#include <QString>
#include <QFile>
#include <QTextStream>
#include <QRegExp>
#include <CGAL/Simple_cartesian.h>
#include <GL/gl.h>
#include "csgtree.h"
#include "MarchingTetrahedrons.h"
#include "camera.h"

typedef CGAL::Simple_cartesian<double>  K;
typedef K::Vector_3                     Vector_3;


class CSGController
{
public:
    CSGTree m_csgTree;
    vector<TRIANGLE> m_vTriangles; //Triangles which are result of the marching cubes algorithm

    CSGController();
    void readCSGFile(QString fileName);
    long int calcIsoSurface(XYZ originPoint , int dims[3] , double spacing[3]);
    void addTriangles(const TRIANGLE *aTriangles , int iNumTri ,  vector<TRIANGLE> &vTriangles);
    void drawPolyhedra();
};

#endif // CSGCONTROLLER_H
